<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>用户订单</title>
    <!-- 引入CSS和JS -->
    <th:block th:insert="~{/fixed/header::head}"></th:block>
</head>
<body>
<!-- 引入头部导航条 -->
<th:block th:insert="~{/fixed/headBar::headBar}"></th:block>

<!--霸屏标签-->
<header>
    <div class="hero-area section-bg2">
        <div class="container">
            <div class="row">
                <div class="col-xl-12">
                    <div class="slider-area">
                        <div class="slider-height2 slider-bg4 d-flex align-items-center justify-content-center">
                            <div class="hero-caption hero-caption2">
                                <h2>用户订单</h2>
                                <nav aria-label="breadcrumb">
                                    <ol class="breadcrumb justify-content-center">
                                        <li class="breadcrumb-item"><a th:href="@{index}">Home</a></li>
                                        <li class="breadcrumb-item"><a href="#">Checkout</a></li>
                                    </ol>
                                </nav>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</header>
<main>
    <section class="cart_area">
        <div class="container">
            <div class="cart_inner">
                <div class="table-responsive">
                    <table class="table" style="text-align: center">
                        <thead>
                        <tr>
                            <th scope="col">#</th>
                            <th scope="col">商品名称</th>
                            <th scope="col">购买数量</th>
                            <th scope="col">支付价格</th>
                            <th scope="col">创建日期</th>
                            <th scope="col">收货人</th>
                            <th scope="col">联系电话</th>
                            <th scope="col">收货地址</th>
                            <th scope="col">订单状态</th>
                        </tr>
                        </thead>
                        <tbody th:each="orders:${ordersAll}">
                        <tr>
                            <td th:text="${ordersStat.count}"></td>
                            <td th:text="${orders.goodsName}"></td>
                            <td th:text="${orders.ordersQuantity}"></td>
                            <td th:text="${orders.ordersPrice}"></td>
                            <td th:text="${orders.ordersDate}"></td>
                            <td th:text="${orders.consignee}"></td>
                            <td th:text="${orders.phone}"></td>
                            <td th:text="${orders.address}"></td>
                            <td>
                                <div th:if="${orders.ordersState} == 0">
                                    <a th:href="@{/pay/aliPay/{orderId}/{price}/{goodsName}/{body}(orderId=${orders.oid},price=${orders.ordersPrice},goodsName=${orders.goodsName},body=${orders.consignee})}" class="alert alert-danger"  >去支付</a>
                                </div>

                                <span class="alert alert-warning" th:if="${orders.ordersState} == 1">待发货</span>

                                <div th:if="${orders.ordersState} == 2">
                                    <a th:href="@{/orders/updata(oid = ${orders.oid})}" class="alert alert-primary"  >确认收货</a>
                                </div>
                                <span class="alert alert-success" th:if="${orders.ordersState} == 3">已完成</span>
                            </td>
                        </tr>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </section>
</main>

<footer>
    <!--JS、Bootstrap代码-->
    <th:block th:insert="~{/fixed/footer::foot}"></th:block>
</footer>
</body>
</html>